<?php

/**
 * Cliente filter form base class.
 *
 * @package    courier
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseClienteFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'cli_ctagoogle' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'cli_nombre'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'cli_apellido'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'cli_fechanac'  => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'cli_ctagoogle' => new sfValidatorPass(array('required' => false)),
      'cli_nombre'    => new sfValidatorPass(array('required' => false)),
      'cli_apellido'  => new sfValidatorPass(array('required' => false)),
      'cli_fechanac'  => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('cliente_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Cliente';
  }

  public function getFields()
  {
    return array(
      'cli_id'        => 'Number',
      'cli_ctagoogle' => 'Text',
      'cli_nombre'    => 'Text',
      'cli_apellido'  => 'Text',
      'cli_fechanac'  => 'Date',
    );
  }
}
